package com.crawler.dao;

import java.sql.Connection;
import java.sql.SQLException;

import com.mchange.v2.c3p0.ComboPooledDataSource;

public class C3P0Drive {
	private volatile static ComboPooledDataSource dataSource = null; 
	private C3P0Drive(){}
	
	public static ComboPooledDataSource getInstence() throws SQLException{
		if(dataSource==null){
			synchronized (C3P0Drive.class) {
				if(dataSource==null){
					dataSource = new ComboPooledDataSource();
					dataSource.setMaxPoolSize(5000);
					dataSource.setMinPoolSize(100);
					dataSource.setInitialPoolSize(200);
				}
			}
		}
		return dataSource;
	}
}
